Class com.symantec.itools.vcafe.openapi.dtreflect.DTClass
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.symantec.itools.vcafe.openapi.dtreflect.DTClass

Object
   |
   +----com.symantec.itools.vcafe.openapi.dtreflect.DTClass

public class DTClass
extends Object
implements Serializable
DTClass is the root class for the dtreflect API for Design Time Reflection.

Design Time Reflection provides services analogous to the Java reflection API, based upon parse information gathered by Visual Cafe. Thus, classes reflected upon need not be compiled or in a compilable state.

There are several significant differences between the dtreflect and reflect packages:

dtreflect usually does not throw an exception when a class, method, field, etc. cannot be found. Instead, the API uniformly returns null, allowing simpler caller code. The nonNull() methods allow callers to quickly and conveniently convert null returns to NullPointerException if this is desired.

The DTListener interface combined with the notify()/notifyAll() methods allows a dtreflect user to listen to specific/all classes for changes. The validate() method of a dtreflect object verifies that the information in the object is up-to-date. validate() should also be called when a dtreflect object is serialized in, as the underlying class, method, etc. may no longer exist or may have changed.

To avoid confusion, the forName() method is renamed findClass().

Since classes may be unique to projects and different classes with the same name may exist in different projects, findClass() requires a Project argument. The findSystemClass() method returns information about classes that are common to all open projects.

dtreflect objects obtain their information from a parser for project files and from compiled code for files outside the project. Because a parser is more forgiving than the compiler, some information may be incomplete or innacurate. In particular, variable, method return and argument types may not be fully qualified. Each object has a validate interface that verifies that all types used by the object could be used to create valid DTClass objects.


Variable Index

 o AnyType
 o BooleanType
 o ByteType
 o CharacterType
 o DoubleType
 o FloatType
 o IntegerType
 o LongType
 o NullType
 o ShortType
 o VoidType
 o cacheFlushDelay

Constructor Index

 o com.symantec.itools.vcafe.openapi.dtreflect.DTClass(DTClass, int)
Constructor used locally for primitive array types (boolean[], char[], etc).
 o com.symantec.itools.vcafe.openapi.dtreflect.DTClass(VisualProject, String, Class, int, boolean, boolean)
Constructor used locally to make a DTClass, usually from a system java.lang.Class
 o com.symantec.itools.vcafe.openapi.dtreflect.DTClass()

Method Index

 o classnameToString(String)
 o componentName(String)
 o equals(Object)
Return true if the other class is the same as this.
 o equals(DTClass)
Return true if the other class is the same as this.
 o findClass(VisualProject, String)
Returns the DTClass object associated with the class with the given string name.
 o findSystemClass(String)
Returns the DTClass object associated with the class with the given string name.
 o getAccessibleFields(DTClass, boolean)
Returns an array of DTField objects reflecting all the fields in the class or interface represented by this DTClass object that can be seen by accessibleBy.
 o getAccessibleMethods(DTClass, boolean)
Returns an array of DTMethod objects reflecting all the methods in the class or interface represented by this DTClass object that can be seen by accessibleBy.
 o getBounds()
Return an array with the bounds of each array dimension for the current class.The length of the returned int array is equal to the number of dimensions of the class.
 o getClasses()
Returns an array containing DTClass objects representing all the public classes and interfaces that are members of the class represented by this DTClass object.
 o getClosestMember(int)
Gets the closest member to the location.
 o getComponentName()
If this class represents an array type, returns the name of the component type; otherwise returns the class name.
 o getComponentType()
If this class represents an array type, returns the DTClass object representing the component type of the array; otherwise returns null.
 o getConstructor(DTClass[])
Returns a DTConstructor object that reflects the specified public constructor of the class represented by this DTClass object.
 o getConstructor(String[])
Returns a DTConstructor object that reflects the specified public constructor of the class represented by this DTClass object.
 o getConstructors()
Returns an array containing DTConstructor objects reflecting all the public constructors of the class represented by this DTClass object.
 o getDeclaredClasses()
Returns an array of DTClass objects reflecting all the classes and interfaces declared as members of the class represented by this DTClass object.
 o getDeclaredConstructor(DTClass[])
Returns a DTConstructor object that reflects the specified declared constructor of the class or interface represented by this DTClass object.
 o getDeclaredConstructor(String[])
Returns a DTConstructor object that reflects the specified declared constructor of the class or interface represented by this DTClass object.
 o getDeclaredConstructors()
Returns an array of DTConstructor objects reflecting all the constructors declared by the class represented by this DTClass object.
 o getDeclaredField(String)
Returns a DTField object that reflects the specified declared field of the class or interface represented by this DTClass object.
 o getDeclaredFields()
Returns an array of DTField objects reflecting all the fields declared by the class or interface represented by this DTClass object.
 o getDeclaredMethod(String, DTClass[])
Returns a DTMethod object that reflects the specified declared method of the class or interface represented by this DTClass object.
 o getDeclaredMethod(String, String[])
Returns a DTMethod object that reflects the specified declared method of the class or interface represented by this DTClass object.
 o getDeclaredMethods()
Returns an array of DTMethod objects reflecting all the methods declared by the class or interface represented by this DTClass object.
 o getDeclaringClass()
If the class or interface represented by this DTClass object is a member of another class, returns the DTClass object representing the class of which it is a member (its declaring class).
 o getDimensions()
If this DTClass object represents an array type, returns the number of array dimensions, otherwise returns false.
 o getField(String)
Returns a DTField object that reflects the specified public member field of the class or interface represented by this DTClass object.
 o getFields()
Returns an array containing DTField objects reflecting all the accessible public fields of the class or interface represented by this DTClass object.
 o getInterfaces()
Determines the interfaces implemented by the class or interface represented by this object.
 o getJavadocRange()
gets the text range from the beginning of the first line of the class' Javadoc comment to the closing asterisk-slash characters
 o getMethod(String, DTClass[])
Returns a DTMethod object that reflects the specified public member method of the class or interface represented by this DTClass object.
 o getMethod(String, String[])
Returns a DTMethod object that reflects the specified public member method of the class or interface represented by this DTClass object.
 o getMethods()
Returns an array containing DTMethod objects reflecting all the public member methods of the class or interface represented by this DTClass object, including those declared by the class or interface and and those inherited from superclasses and superinterfaces.
 o getModifiers()
Returns the Java language modifiers for this class or interface, encoded in an integer.
 o getName()
Returns the fully-qualified name of the type (class, interface, array, or primitive) represented by this DTClass object, as a String.
 o getPackageName()
Returns the package of the type (class, interface, array, or primitive) represented by this DTClass object as a String, or null if the class isn't in a package
 o getPrimitiveClass(String)
Return a DTClass object for the named primitive type.
 o getProject()
Return the VisualProject that defines the class, or null for a system class.
 o getProjectFile()
Return the ProjectFile that defines the class, or null for a system class.
 o getProjectFileID()
Return the ID of the ProjectFile that defines the class, or 0 for a system class.
 o getProjectLoader()
Return classloader for this class (project's classloader).
 o getSourceFile()
Return the SourceFile that contains the class, or null if not found.
 o getSourceRange()
gets the text range from the beginning of the "class" statement to the closing brace
 o getSuperclass()
If this object represents any class other than the class Object, then the object that represents the superclass of that class is returned.
 o getUnqualifiedName()
Returns the unqualified name (package is excluded) of the type (class, interface, array, or primitive) represented by this DTClass object, as a String.
 o isArray()
If this DTClass object represents an array type, returns true, otherwise returns false.
 o isAssignable(DTClass)
Determines if a value of a specified type can be assigned without explicit conversion or casting to a value of this type.
 o isAssignable(long)
Determines if a specified constant value can be assigned without explicit conversion or casting to a value of this type.
 o isAssignableFrom(DTClass)
Determines if the class or interface represented by this DTClass object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified DTClass parameter.
 o isImplementationOf(DTClass)
Determines if the class or interface represented by this DTClass object implements or extends the class or interface represented by the specified DTClass parameter.
 o isInteger()
Return true if the argument is a byte, short, int or long.
 o isInterface()
Determines if the specified DTClass object represents an interface type.
 o isNumeric()
Return true if the argument is a number, i.e., byte, short, int, long, float or double.
 o isPrimitive()
Determines if the specified DTClass object represents a primitive Java type.
 o isProjectClass()
Return true if class is in a project, as opposed to component library or system classpath.
 o isSuperclass(DTClass)
Returns true if the argument object is a superclass of the current class.
 o isValid()
Return value of last validate().
 o nonNull()
nonNull does nothing except throw a NullPointerException if called with null DTClass reference
 o nonNull(Object)
nonNull does nothing except throw a NullPointerException if called with null reference
 o nonNull(DTClass[])
nonNull does nothing except throw a NullPointerException if called with a null DTClass[] reference or if any of its components are null.
 o rename(String)
Renames a type to new name param newName: The new name of the class
 o scanDim(String)
 o toString()
Converts the object to a string.
 o validate()
Validate that the class still exists and the information about the class is correct.

Variables

 o AnyType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass AnyType
 o BooleanType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass BooleanType
 o ByteType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass ByteType
 o CharacterType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass CharacterType
 o DoubleType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass DoubleType
 o FloatType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass FloatType
 o IntegerType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass IntegerType
 o LongType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass LongType
 o NullType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass NullType
 o ShortType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass ShortType
 o VoidType
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass VoidType
 o cacheFlushDelay
public static int cacheFlushDelay

Constructors

 o DTClass
protected DTClass(DTClass primitiveType,
                  int dim)
Constructor used locally for primitive array types (boolean[], char[], etc).

 o DTClass
protected DTClass(VisualProject project,
                  String name,
                  Class clazz,
                  int dim,
                  boolean primitive,
                  boolean projectClass)
Constructor used locally to make a DTClass, usually from a system java.lang.Class

 o DTClass
protected DTClass()

Methods

 o classnameToString
protected static java.lang.String classnameToString(String name)
 o componentName
protected static java.lang.String componentName(String str)
 o equals
public boolean equals(Object obj)
Return true if the other class is the same as this.

If classes are equal and both are valid, all of the information about the class is the same.

Parameters:
other - class to be compared.
Overrides:
equals in class Object
 o equals
public boolean equals(DTClass other)
Return true if the other class is the same as this.

If classes are equal and both are valid, all of the information about the class is the same.

Parameters:
other - class to be compared.
 o findClass
public static com.symantec.itools.vcafe.openapi.dtreflect.DTClass findClass(VisualProject project,
                                                                            String className)
Returns the DTClass object associated with the class with the given string name.

Given a project and the fully-qualified name for a class or interface, this method attempts to create a DTClass object for the class. If it succeeds, returns the DTClass object representing the class. If it fails, the method returns null.

For example, the following code fragment returns the runtime DTClass descriptor for the class named com.user.MyClass:

Array classes are represented using standard notation, e.g., "java.lang.String[]" and "byte[][]".

If the className names a system class or the project is null, findClass() is the same as findSystemClass(). NB: A project must be specified for a component library class, which is not in the system classpath.

Parameters:
project - the project context that defines the class.
className - the fully qualified name of the desired class.
Returns:
the DTClass descriptor for the class with the specified name. Returns null if class not found.
See Also:
getDTClassObject(), findSystemClass()
 o findSystemClass
public static com.symantec.itools.vcafe.openapi.dtreflect.DTClass findSystemClass(String className)
Returns the DTClass object associated with the class with the given string name.

The class must be loadable from the system classpath.

For example, the following code fragment returns the runtime DTClass descriptor for the standard String class:

Parameters:
className - the fully qualified name of the desired class.
Returns:
the DTClass descriptor for the class with the specified name. Returns null if class not found.
 o getAccessibleFields
public com.symantec.itools.vcafe.openapi.dtreflect.DTField[] getAccessibleFields(DTClass accessibleByClass,
                                                                                 boolean sameObject)
Returns an array of DTField objects reflecting all the fields in the class or interface represented by this DTClass object that can be seen by accessibleBy. This includes all public fields, protected fields if accessibleBy is a subclass of this class (and they represent the same object), and fields with package access if accessibleBy is in the same package as this class. Inherited fields are included. Returns an array of length 0 if the class or interface declares no fields, or if this DTClass object represents a primitive type.

See Also:
getFields
 o getAccessibleMethods
public com.symantec.itools.vcafe.openapi.dtreflect.DTMethod[] getAccessibleMethods(DTClass accessibleByClass,
                                                                                   boolean sameObject)
Returns an array of DTMethod objects reflecting all the methods in the class or interface represented by this DTClass object that can be seen by accessibleBy. This includes all public methods, protected methods if accessibleBy is a subclass of this class (and they represent the same object), and methods with package access if accessibleBy is in the same package as this class. Inherited methods are included. Returns an array of length 0 if the class or interface declares no methods, or if this DTClass object represents a primitive type.

See Also:
getMethods
 o getBounds
public int[] getBounds()
Return an array with the bounds of each array dimension for the current class.The length of the returned int array is equal to the number of dimensions of the class. Returns empty array if the class is not an array.

 o getClasses
public com.symantec.itools.vcafe.openapi.dtreflect.DTClass[] getClasses()
Returns an array containing DTClass objects representing all the public classes and interfaces that are members of the class represented by this DTClass object. This includes public class and interface members inherited from superclasses and public class and interface members declared by the class. Returns an array of length 0 if the class has no public member classes or interfaces, or if this DTClass object represents a primitive type.

 o getClosestMember
public com.symantec.itools.vcafe.openapi.dtreflect.DTMember getClosestMember(int location)
Gets the closest member to the location. The closest member is the member with a source range or Javadoc range that surrounds the location

 o getComponentName
public java.lang.String getComponentName()
If this class represents an array type, returns the name of the component type; otherwise returns the class name.

 o getComponentType
public com.symantec.itools.vcafe.openapi.dtreflect.DTClass getComponentType()
If this class represents an array type, returns the DTClass object representing the component type of the array; otherwise returns null.

 o getConstructor
public com.symantec.itools.vcafe.openapi.dtreflect.DTConstructor getConstructor(DTClass[] parameterTypes)
Returns a DTConstructor object that reflects the specified public constructor of the class represented by this DTClass object. The parameterTypes parameter is an array of DTClass objects that identify the constructor's formal parameter types, in declared order.

The constructor to reflect is located by searching all the constructors of the class represented by this DTClass object for a public constructor with the exactly the same formal parameter types.

Returns:
constructor or null if no such constructor.
See Also:
DTConstructor
 o getConstructor
public com.symantec.itools.vcafe.openapi.dtreflect.DTConstructor getConstructor(String[] parameterTypeNames)
Returns a DTConstructor object that reflects the specified public constructor of the class represented by this DTClass object. The parameterTypeNames parameter is an array of String objects that identify the constructor's formal parameter types, in declared order.

The constructor to reflect is located by searching all the constructors of the class represented by this DTClass object for a public constructor with the exactly the same formal parameter types.

Returns:
constructor or null if no such constructor.
See Also:
DTConstructor
 o getConstructors
public com.symantec.itools.vcafe.openapi.dtreflect.DTConstructor[] getConstructors()
Returns an array containing DTConstructor objects reflecting all the public constructors of the class represented by this DTClass object. An array of length 0 is returned if the class has no public constructors.

See Also:
DTConstructor
 o getDeclaredClasses
public com.symantec.itools.vcafe.openapi.dtreflect.DTClass[] getDeclaredClasses()
Returns an array of DTClass objects reflecting all the classes and interfaces declared as members of the class represented by this DTClass object. This includes public, protected, default (package) access, and private classes and interfaces declared by the class, but excludes inherited classes and interfaces. Returns an array of length 0 if the class declares no classes or interfaces as members, or if this DTClass object represents a primitive type.

 o getDeclaredConstructor
public com.symantec.itools.vcafe.openapi.dtreflect.DTConstructor getDeclaredConstructor(DTClass[] parameterTypes)
Returns a DTConstructor object that reflects the specified declared constructor of the class or interface represented by this DTClass object. The parameterTypes parameter is an array of DTClass objects that identify the constructor's formal parameter types, in declared order.

See Also:
DTConstructor
 o getDeclaredConstructor
public com.symantec.itools.vcafe.openapi.dtreflect.DTConstructor getDeclaredConstructor(String[] parameterTypeNames)
Returns a DTConstructor object that reflects the specified declared constructor of the class or interface represented by this DTClass object. The parameterTypeNames parameter is an array of String objects that identify the constructor's formal parameter types, in declared order.

See Also:
DTConstructor
 o getDeclaredConstructors
public com.symantec.itools.vcafe.openapi.dtreflect.DTConstructor[] getDeclaredConstructors()
Returns an array of DTConstructor objects reflecting all the constructors declared by the class represented by this DTClass object. These are public, protected, default (package) access, and private constructors. Returns an array of length 0 if this DTClass object represents an interface or a primitive type.

See The Java Language Specification, section 8.2.

See Also:
DTConstructor
 o getDeclaredField
public com.symantec.itools.vcafe.openapi.dtreflect.DTField getDeclaredField(String name)
Returns a DTField object that reflects the specified declared field of the class or interface represented by this DTClass object. The name parameter is a String that specifies the simple name of the desired field.

See Also:
DTField
 o getDeclaredFields
public com.symantec.itools.vcafe.openapi.dtreflect.DTField[] getDeclaredFields()
Returns an array of DTField objects reflecting all the fields declared by the class or interface represented by this DTClass object. This includes public, protected, default (package) access, and private fields, but excludes inherited fields. Returns an array of length 0 if the class or interface declares no fields, or if this DTClass object represents a primitive type. See The Java Language Specification, sections 8.2 and 8.3.

See Also:
DTField
 o getDeclaredMethod
public com.symantec.itools.vcafe.openapi.dtreflect.DTMethod getDeclaredMethod(String name,
                                                                              DTClass[] parameterTypes)
Returns a DTMethod object that reflects the specified declared method of the class or interface represented by this DTClass object. The name parameter is a String that specifies the simple name of the desired method, and the parameterTypes parameter is an array of DTClass objects that identify the method's formal parameter types, in declared order.

See Also:
DTMethod
 o getDeclaredMethod
public com.symantec.itools.vcafe.openapi.dtreflect.DTMethod getDeclaredMethod(String name,
                                                                              String[] parameterTypeNames)
Returns a DTMethod object that reflects the specified declared method of the class or interface represented by this DTClass object. The name parameter is a String that specifies the simple name of the desired method, and the parameterTypeNames parameter is an array of DTClass objects that identify the method's formal parameter types, in declared order.

See Also:
DTMethod
 o getDeclaredMethods
public com.symantec.itools.vcafe.openapi.dtreflect.DTMethod[] getDeclaredMethods()
Returns an array of DTMethod objects reflecting all the methods declared by the class or interface represented by this DTClass object. This includes public, protected, default (package) access, and private methods, but excludes inherited methods. Returns an array of length 0 if the class or interface declares no methods, or if this DTClass object represents a primitive type.

See The Java Language Specification, section 8.2.

See Also:
DTMethod
 o getDeclaringClass
public com.symantec.itools.vcafe.openapi.dtreflect.DTClass getDeclaringClass()
If the class or interface represented by this DTClass object is a member of another class, returns the DTClass object representing the class of which it is a member (its declaring class). Returns null if this class or interface is not a member of any other class.

 o getDimensions
public int getDimensions()
If this DTClass object represents an array type, returns the number of array dimensions, otherwise returns false.

 o getField
public com.symantec.itools.vcafe.openapi.dtreflect.DTField getField(String name)
Returns a DTField object that reflects the specified public member field of the class or interface represented by this DTClass object. The name parameter is a String specifying the simple name of the desired field.

The field to be reflected is located by searching all the member fields of the class or interface represented by this DTClass object for a public field with the specified name.

See The Java Language Specification, sections 8.2 and 8.3.

Returns:
field or null if no such field.
See Also:
DTField
 o getFields
public com.symantec.itools.vcafe.openapi.dtreflect.DTField[] getFields()
Returns an array containing DTField objects reflecting all the accessible public fields of the class or interface represented by this DTClass object. Returns an array of length 0 if the class or interface has no accessible public fields, or if it represents an array type or a primitive type.

Specifically, if this DTClass object represents a class, returns the public fields of this class and of all its superclasses. If this DTClass object represents an interface, returns the fields of this interface and of all its superinterfaces. If this DTClass object represents an array type or a primitive type, returns an array of length 0.

The implicit length field for array types is not reflected by this method. User code should use the methods of class Array to manipulate arrays.

See The Java Language Specification, sections 8.2 and 8.3.

See Also:
DTField
 o getInterfaces
public com.symantec.itools.vcafe.openapi.dtreflect.DTClass[] getInterfaces()
Determines the interfaces implemented by the class or interface represented by this object.

If this object represents a class, the return value is an array containing objects representing all interfaces implemented by the class. The order of the interface objects in the array corresponds to the order of the interface names in the implements clause of the declaration of the class represented by this object.

If this object represents an interface, the array contains objects representing all interfaces extended by the interface. The order of the interface objects in the array corresponds to the order of the interface names in the extends clause of the declaration of the interface represented by this object.

If the class or interface implements no interfaces, the method returns an array of length 0.

Returns:
an array of interfaces implemented by this class.
 o getJavadocRange
public com.symantec.itools.vcafe.openapi.Range getJavadocRange()
gets the text range from the beginning of the first line of the class' Javadoc comment to the closing asterisk-slash characters

 o getMethod
public com.symantec.itools.vcafe.openapi.dtreflect.DTMethod getMethod(String name,
                                                                      DTClass[] parameterTypes)
Returns a DTMethod object that reflects the specified public member method of the class or interface represented by this DTClass object. The name parameter is a String specifying the simple name the desired method, and the parameterTypes parameter is an array of DTClass objects that identify the method's formal parameter types, in declared order.

The method to reflect is located by searching all the member methods of the class or interface represented by this DTClass object for a public method with the specified name and exactly the same formal parameter types.

See The Java Language Specification, sections 8.2 and 8.4.

Returns:
method or null if no such method.
See Also:
DTMethod
 o getMethod
public com.symantec.itools.vcafe.openapi.dtreflect.DTMethod getMethod(String name,
                                                                      String[] parameterTypeNames)
Returns a DTMethod object that reflects the specified public member method of the class or interface represented by this DTClass object. The name parameter is a String specifying the simple name the desired method, and the parameterTypeNames parameter is an array of String objects that identify the method's formal parameter types, in declared order.

The method to reflect is located by searching all the member methods of the class or interface represented by this DTClass object for a public method with the specified name and exactly the same formal parameter types.

See The Java Language Specification, sections 8.2 and 8.4.

Returns:
method or null if no such method.
See Also:
DTMethod
 o getMethods
public com.symantec.itools.vcafe.openapi.dtreflect.DTMethod[] getMethods()
Returns an array containing DTMethod objects reflecting all the public member methods of the class or interface represented by this DTClass object, including those declared by the class or interface and and those inherited from superclasses and superinterfaces. Returns an array of length 0 if the class or interface has no public member methods.

See The Java Language Specification, sections 8.2 and 8.4.

See Also:
DTMethod
 o getModifiers
public int getModifiers()
Returns the Java language modifiers for this class or interface, encoded in an integer. The modifiers consist of the Java Virtual Machine's constants for public, protected, private, final, and interface; they should be decoded using the methods of class Modifier.

The modifier encodings are defined in The Java Virtual Machine Specification, table 4.1.

See Also:
Modifier
 o getName
public java.lang.String getName()
Returns the fully-qualified name of the type (class, interface, array, or primitive) represented by this DTClass object, as a String.

Array classes are named using standard notation, e.g., "java.lang.String[]" and "byte[][]".

 o getPackageName
public java.lang.String getPackageName()
Returns the package of the type (class, interface, array, or primitive) represented by this DTClass object as a String, or null if the class isn't in a package

 o getPrimitiveClass
public static com.symantec.itools.vcafe.openapi.dtreflect.DTClass getPrimitiveClass(String name)
Return a DTClass object for the named primitive type.

Returns:
null if name is not a primitive type
 o getProject
public com.symantec.itools.vcafe.openapi.VisualProject getProject()
Return the VisualProject that defines the class, or null for a system class.

 o getProjectFile
public com.symantec.itools.vcafe.openapi.ProjectFile getProjectFile()
Return the ProjectFile that defines the class, or null for a system class.

 o getProjectFileID
public int getProjectFileID()
Return the ID of the ProjectFile that defines the class, or 0 for a system class.

 o getProjectLoader
public java.lang.ClassLoader getProjectLoader()
Return classloader for this class (project's classloader).

 o getSourceFile
public com.symantec.itools.vcafe.openapi.SourceFile getSourceFile()
Return the SourceFile that contains the class, or null if not found.

 o getSourceRange
public com.symantec.itools.vcafe.openapi.Range getSourceRange()
gets the text range from the beginning of the "class" statement to the closing brace

 o getSuperclass
public com.symantec.itools.vcafe.openapi.dtreflect.DTClass getSuperclass()
If this object represents any class other than the class Object, then the object that represents the superclass of that class is returned.

If this object is the one that represents the class Object or this object represents an interface, null is returned.

Returns:
the superclass of the class represented by this object.
 o getUnqualifiedName
public java.lang.String getUnqualifiedName()
Returns the unqualified name (package is excluded) of the type (class, interface, array, or primitive) represented by this DTClass object, as a String.

Array classes are named using standard notation, e.g., "String[]" and "byte[][]".

 o isArray
public boolean isArray()
If this DTClass object represents an array type, returns true, otherwise returns false.

 o isAssignable
public boolean isAssignable(DTClass cls)
Determines if a value of a specified type can be assigned without explicit conversion or casting to a value of this type.

Differs from isAssignableFrom() in its treatment of primitive classes.

Specifically, this method tests whether the type represented by the specified DTClass parameter can be converted to the type represented by this DTClass object via an identity conversion, a widening reference conversion or a widening numeric conversion. See The Java Language Specification, sections 5.1.1, 5.1.4 and 5.2, for details.

Note that a particular numeric constant value might be assignable via a narrowing conversion if its value fits in the destination type without loss of information, e.g., byte b = 52; where the constant 52 is an int. This must be tested using isAssignable(int) with the specific value.

Throws: NullPointerException
if the specified DTClass parameter is null.
 o isAssignable
public boolean isAssignable(long value)
Determines if a specified constant value can be assigned without explicit conversion or casting to a value of this type.

A particular numeric constant value is assignable if its value fits in the destination type without loss of information, e.g., byte b = 52; where the constant 52 is an int.

 o isAssignableFrom
public boolean isAssignableFrom(DTClass cls)
Determines if the class or interface represented by this DTClass object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified DTClass parameter. It returns true if so, false otherwise. If this DTClass object represents a primitive type, returns true if the specified DTClass parameter is exactly this DTClass object, false otherwise.

Specifically, this method tests whether the type represented by the specified DTClass parameter can be converted to the type represented by this DTClass object via an identity conversion or via a widening reference conversion. See The Java Language Specification, sections 5.1.1 and 5.1.4 , for details.

This method works the same as Class.isAssignableFrom(), which means it is not accurate for primitive classes.

Throws: NullPointerException
if the specified DTClass parameter is null.
See Also:
isAssignable
 o isImplementationOf
public boolean isImplementationOf(DTClass cls)
Determines if the class or interface represented by this DTClass object implements or extends the class or interface represented by the specified DTClass parameter. It returns true if so, false otherwise. If this DTClass object represents a primitive type, returns true if the specified DTClass parameter is exactly this DTClass object, false otherwise.

For non-primitive types, returns what the implements operator would for corresponding Class objects.

This is the opposite of isAssignableFrom().

Throws: NullPointerException
if the specified DTClass parameter is null.
 o isInteger
public boolean isInteger()
Return true if the argument is a byte, short, int or long.

 o isInterface
public boolean isInterface()
Determines if the specified DTClass object represents an interface type.

Returns:
true if this object represents an interface; false otherwise.
 o isNumeric
public boolean isNumeric()
Return true if the argument is a number, i.e., byte, short, int, long, float or double.

 o isPrimitive
public boolean isPrimitive()
Determines if the specified DTClass object represents a primitive Java type.

There are nine predefined DTClass objects to represent the eight primitive Java types and void. These are created by the DTReflection API, and have the same names as the primitive types that they represent, namely boolean, byte, char, short, int, long, float, and double, and void.

These objects may only be accessed via the following public static final variables, and are the only DTClass objects for which this method returns true. com.symantec.itools.vcafe.openapi.dtreflect.DTClass.BooleanType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.CharacterType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.ByteType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.ShortType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.IntegerType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.LongType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.FloatType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.DoubleType com.symantec.itools.vcafe.openapi.dtreflect.DTClass.VoidType

 o isProjectClass
public boolean isProjectClass()
Return true if class is in a project, as opposed to component library or system classpath.

 o isSuperclass
public boolean isSuperclass(DTClass superClass)
Returns true if the argument object is a superclass of the current class.

 o isValid
public boolean isValid()
Return value of last validate().

 o nonNull
public final com.symantec.itools.vcafe.openapi.dtreflect.DTClass nonNull()
nonNull does nothing except throw a NullPointerException if called with null DTClass reference

Returns:
reference to calling object
 o nonNull
public final java.lang.Object nonNull(Object obj)
nonNull does nothing except throw a NullPointerException if called with null reference

Returns:
reference to calling object
 o nonNull
public static final com.symantec.itools.vcafe.openapi.dtreflect.DTClass[] nonNull(DTClass[] array)
nonNull does nothing except throw a NullPointerException if called with a null DTClass[] reference or if any of its components are null. #

Parameters:
array - of DTClass references
Returns:
reference to array argument
 o rename
public boolean rename(String newName)
Renames a type to new name param newName: The new name of the class

Returns:
Success (true) or failure (false)...
 o scanDim
protected static int scanDim(String className)
 o toString
public java.lang.String toString()
Converts the object to a string. The string representation is the string "class" or "interface" followed by a space and then the fully qualified name of the class. If this DTClass object represents a primitive type, returns the name of the primitive type.

Returns:
a string representation of this class object.
Overrides:
toString in class Object
 o validate
public boolean validate()
Validate that the class still exists and the information about the class is correct. Sets the valid flag to the result of validate().

Returns:
true if the DTClass object is valid, false otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index